package com.ozy.kxreader.mvp.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.ozy.kxreader.R
import com.ozy.kxreader.base.Constant.IMG_BASE_URL
import com.ozy.kxreader.loadImage
import com.ozy.kxreader.mvp.model.entity.BookList
import kotlinx.android.synthetic.main.item_book.view.*

/**
 * Created by 欧源 on 2018/2/2.
 */
class BookListAdapter : BaseQuickAdapter<BookList.BooksBean, BaseViewHolder>(R.layout.item_book) {

    override fun convert(helper: BaseViewHolder?, item: BookList.BooksBean?) {
        var itemView = helper?.itemView
        itemView?.tv_title?.text = item?.title
        itemView?.tv_author?.text = item?.author
        itemView?.tv_category?.text = item?.majorCate
        itemView?.tv_describe?.text = item?.shortIntro
        loadImage(mContext, IMG_BASE_URL + item?.cover, R.mipmap.cover_default, R.mipmap.cover_default, itemView?.iv_image)
    }

}